package com.fxf.srb.core.controller.admin;

import com.fxf.common.result.R;
import com.fxf.srb.core.pojo.entity.LendReturn;
import com.fxf.srb.core.service.ILendReturnService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 饭小范
 * @version 1.0
 * @description: TODO
 * @date 2021/6/6 22:52
 */
@Slf4j
@Api(tags = "还款记录")
@RestController
@RequestMapping("/admin/core/lendReturn")
public class AdminLendReturnController {

    @Resource
    private ILendReturnService iLendReturnService;

    @ApiOperation(value = "获取还款记录列表")
    @RequestMapping("/list/{lendId}")
    public R list(
            @ApiParam(value = "标的id",required = true)
            @PathVariable("lendId") Long lendId){

        List<LendReturn> lendReturnList =  iLendReturnService.selectByLendId(lendId);
        return R.ok().data("lendReturnList",lendReturnList);

    }
}
